import compUtil from '@/utils/comp-util'

export default {
  options(h, conf, key) {
    const list = []
    if (conf.__slot__ && conf.__slot__.options) {
      conf.__slot__.options.forEach(item => {
        const types = compUtil.allItemType(conf.__slot__.options.map(v => v.value))
        const val = compUtil.toValue(types, item.value)
        list.push(h('el-option', {
          label: item.label,
          value: val,
          disabled: item.disabled
        }))
      })
    }
    return list
  }
}